package org.misty.blog.service;

import org.misty.blog.po.Article;
import org.misty.blog.vo.ArticleQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;
import java.util.Optional;

public interface ArticleService {
    Optional<Article> getArticle(Long id);

    Optional<Article> viewArticle(Long id);

    Page<Article> listArticles(Pageable pageable, ArticleQuery search);

    Page<Article> listArticles(Pageable pageable);

    Page<Article> listArticlesByTagId(Pageable pageable, Long tagId);

    List<Article> listTop(int n);

    Map<String, List<Article>> archiveArticles();

    long countArticle();

    Article saveArticle(Article article);

    Article updateArticle(Long id, Article article);

    void deleteArticle(Long id);
}
